function TaskItem(option) {
	this.taskId = this.uuid();// it's random UUID
	this.createTime = new Date();
	this.lastModifyTime = this.createTime;

	this.desc = null;
	this.alertTime = null;
	this.status = 0; // 0: new task, 1: deleted, 2: invalid, 3: finished

	if (option) {
		if (option.desc && option.alertTime) {
			this.desc = option.desc;
			this.alertTime = option.alertTime;
		} else {
			throw "desc and alertTime can not be null.";
		}
		this.taskId = option.uuid ? option.uuid : this.taskId;
		this.createTime = option.createTime ? option.createTime
				: this.createTime;
		this.lastModifyTime = option.lastModifyTime ? option.lastModifyTime
				: this.lastModifyTime;
		this.status = option.status ? option.status : this.status;
	}
};

TaskItem.prototype.uuid = function() {
	var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,
			function(c) {
				var r = Math.random() * 16 | 0, v = c == 'x' ? r
						: r & 0x3 | 0x8;
				return v.toString(16);
			});
	return uuid;
};

TaskItem.prototype.getSimpleTaskTime = function() {
	var time = new Date(this.alertTime);
	return time.getHours() + ":" + (time.getMinutes() > 9 ? time.getMinutes()
			: "0" + time.getMinutes());
};

TaskItem.prototype.getTaskId = function() {
	return this.taskId;
};

TaskItem.prototype.setTaskId = function(taskId) {
	this.taskId = taskId;
};

TaskItem.prototype.getCreateTime = function() {
	return this.createTime;
};

TaskItem.prototype.setCreateTime = function(createTime) {
	this.createTime = createTime;
};

TaskItem.prototype.getLastModifyTime = function() {
	return this.lastModifyTime;
};

TaskItem.prototype.setLastModifyTime = function(lastModifyTime) {
	this.lastModifyTime = lastModifyTime;
};

TaskItem.prototype.getDesc = function() {
	return this.desc;
};

TaskItem.prototype.setDesc = function(desc) {
	this.desc = desc;
};

TaskItem.prototype.getAlertTime = function() {
	return this.alertTime;
};

TaskItem.prototype.setAlertTime = function(alertTime) {
	this.alertTime = alertTime;
};

TaskItem.prototype.getStatus = function() {
	return this.status;
};

TaskItem.prototype.setStatus = function(status) {
	this.status = status;
};

function util() {
	var objectName = "TaskItem";
	var fields = [ "taskId", "createTime", "lastModifyTime", "desc",
			"alertTime" ];
	var codes = "";
	for ( var i = 0; i < fields.length; i++) {
		var upperStr = fields[i].substring(0, 1).toUpperCase()
				+ fields[i].substring(1);
		codes += objectName + ".prototype.get" + upperStr
				+ "=function(){return this." + fields[i] + ";};";

		codes += "\n";

		codes += objectName + ".prototype.set" + upperStr + "=function("
				+ fields[i] + "){ this." + fields[i] + "=" + fields[i] + ";};";

	}
}